package april.test_4_11;

import org.omg.CORBA.CODESET_INCOMPATIBLE;

import java.util.Scanner;

public class TestMain1 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        String str = scanner.nextLine();
        for (int i = 0; i < n; i++) {
            String s = scanner.nextLine();
            StringBuilder sb = new StringBuilder();
            for (int j = 0; j < s.length(); j++) {
                if(isOk(j + 1) % 2 != 0) {
                    sb.append(Character.toUpperCase(s.charAt(j)));
                } else {
                    sb.append(s.charAt(j));
                }
            }
            System.out.println(sb.toString());
        }
    }
    private static int isOk(int num) {
        int count = 0;
        while (num != 0) {
            count += num & 1;
            num >>= 1;
        }
        return count;
    }
}
